import { getAssetsCategorySelect,getCategoryClassSelect } from '@/services/ant-design-pro/api';  

// 根据 categoryClass 获取类别数据  
export const fetchAssetsData = async (categoryClass: number) => {  
    const response = await getAssetsCategorySelect({ categoryclass: categoryClass });  
    return response.map((item: any) => ({  
        label: item.description, // ProFormSelect 需要的显示文本  
        value: item.type,       // ProFormSelect 需要的实际值  
    }));  
};  

export const fetchCategoryData = async () => {  
    const response = await getCategoryClassSelect();  
    return response.map((item: any) => ({  
        label: item.description,     // ProFormSelect 需要的显示文本  
        value: item.category,       // ProFormSelect 需要的实际值  
    }));  
};  


// 封装请求数据的函数  
export const fetchassetsvaluelable = async (categoryClass: number) => {  
    return await fetchAssetsData(categoryClass);  
};  
// 封装请求数据的函数  
export const fetchcategoryvaluelable = async () => {  
    return await fetchCategoryData();  
};  